home *** CD-ROM | disk | FTP | other *** search
- Path: tmpnews.crd.ge.com!rebecca!rpi!not-for-mail
- From: clamage@Eng.Sun.COM (Steve Clamage)
- Newsgroups: comp.lang.c++.moderated,comp.lang.c++
- Subject: Re: enum expression is IF statement
- Date: 17 Feb 1996 02:55:55 -0000
- Organization: Sun Microsystems Inc., Mountain View, CA
- Sender: cppmods@netlab.cs.rpi.edu
- Approved: vandevod@cs.rpi.edu
- Message-ID: <4g3g3r$7as@netlab.cs.rpi.edu>
- References: <4fq7dc$pac@netlab.cs.rpi.edu> <4g1pj9$pqg@netlab.cs.rpi.edu>
- NNTP-Posting-Host: netlab.cs.rpi.edu
- X-Original-Date: 17 Feb 1996 01:26:55 GMT
-
- gstern@earth.usa.net (Greg Sternberg/PDS Inc) writes:
-
- > You're making the assumption that the compiler is numbering your enums
- > sequentially from 0 - since the standard says nothing about how the
- > compiler could number your enums it could very well be using 0x1, 0x2,
- > 0x4, and 0x8.
-
- It has always been the rule in C and C++ that if you do not supply
- values for enumerators, they are numbered sequentially from zero.
- You can find the rule in K&R1 (1978) and in the current draft
- C++ standard (1996).
- --
- Steve Clamage, stephen.clamage@eng.sun.com
-
- [ Articles to moderate: mailto:c++-submit@netlab.cs.rpi.edu ]
- [ Read the C++ FAQ: http://www.connobj.com/cpp/cppfaq.htm ]
- [ Moderation policy: http://www.connobj.com/cpp/guide.htm ]
- [ Comments? mailto:c++-request@netlab.cs.rpi.edu ]
-